﻿// -----------------------------------------------------------------------
// <copyright file="SessionForm.cs" company="Wut??">
// Get some copy, right!
// </copyright>
// -----------------------------------------------------------------------

namespace Eeeek
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    /// <summary>
    /// Grabs a session name
    /// </summary>
    public partial class SessionForm : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SessionForm"/> class.
        /// </summary>
        public SessionForm()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Gets the name of the session.
        /// </summary>
        /// <value>
        /// The name of the session.
        /// </value>
        public string SessionName
        {
            get
            {
                if (!string.IsNullOrWhiteSpace(this.NameTextBox.Text))
                {
                    return this.NameTextBox.Text.Trim();
                }

                return null;
            }
        }

        /// <summary>
        /// Handles the TextChanged event of the NameTextBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NameTextBoxTextChanged(object sender, EventArgs e)
        {
            this.ButtonOk.Enabled = !string.IsNullOrWhiteSpace(this.NameTextBox.Text);
        }
    }
}
